package livingarea.Members;

import livingarea.LivingArea;
import livingarea.actions.DethType;
import livingarea.actions.SpawnType;

/**
 *
 * @author Muzalevskiy Vitaliy
 */
public abstract class NonLivingMember implements AreaMember {
    
    /**Object of <code> LivingArea </code> type in which current area member lives.*/
    protected LivingArea livingArea;
    protected Position position;
    protected int lifeCount;
    /**Current object realized spawn behavior of current area member.*/
    protected SpawnType spawnType;
    /**Current object realized death behavior of current area member.*/
    protected DethType dethType;

    public NonLivingMember(LivingArea livingArea) {
        this.livingArea = livingArea;
        position = livingArea.getCoordinates().setMemberPosition();
        livingArea.blockPosition(position);
        livingArea.addMember(this);
    }        

    public NonLivingMember(LivingArea livingArea, Position position) {
        this.livingArea = livingArea;
        this.position = position;
        livingArea.blockPosition(position);
        livingArea.addMember(this);
    }      

    public abstract void lifeCicle();

    @Override
    public Position getPosition() {
        return position;
    }

    @Override
    public LivingArea getLivingArea() {
        return livingArea;
    }

    @Override
    public void increaseLifeCount() {
        lifeCount++;
    }
    
    @Override
    public int getLifeCount() {
        return lifeCount;
    }
    
    @Override
    public boolean isMovable(){
        return false;
    }
    
    @Override
    public boolean isPray(){
        return false;
    }
}
